<?php 

/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/

	$number_element = $_COOKIE['number_element'];
	if ($this->is_success=='done')
	{
		if ($_COOKIE['number_element']==0)
			setcookie('number_element',1);
		else	
			setcookie('number_element',0);
	}
	

?>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
	
	result = '<?php echo $this->is_success; ?>';
	path = "<?php echo $this->upload_file_path; ?>";
	div_succ = window.parent.document.getElementById('success_msg');
	div_err = window.parent.document.getElementById('error_msg');
	div_file_list = window.parent.document.getElementById('file_list');
	if (result=='done')
	{
		
//		div_succ.setStyle('display','block');
//		div_err.setStyle('display','none');
		div_succ.style.display='block';
		div_err.style.display='none';
		div_succ.innerHTML = '<?php echo JText::_('Upload file successfully'); ?>';
		if (path)
		{
			filename = '<?php echo basename($this->upload_file_path); ?>';
			window.parent.document.uploadfile.upload_file_path.value=path;
			div_file_list.innerHTML += '<li class="element<?php echo $number_element; ?>"><input onclick="window.document.uploadfile.upload_file_path.value=\'<?php echo $this->upload_file_path; ?>\';" checked="checked" type="radio" name="select_file" value="' + path + '" />' + filename + '</li>';
		}
	}
	else
	{
//		error_msg = '<?php echo isset($_COOKIE['upload_error_msg'])?$_COOKIE['upload_error_msg']:''; ?>';
//		div_succ.setStyle('display','none');
//		div_err.setStyle('display','block');
		div_succ.style.display='none';
		div_err.style.display='block';
		div_err.innerHTML = path;
	}
/* ]]> */
</script>
